From 18c7fb2f442ad51efbf170f18245947548bdae80 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 8 May 2006 13:55:24 +0000 Subject: [PATCH] Update the internationalization answer. (#340951, Kristof Versant) 2006-05-08 Matthias Clasen * gtk/question_index.sgml (reference): Update the internationalization answer. (#340951, Kristof Versant) --- docs/reference/ChangeLog | 5 +++++ docs/reference/gtk/question_index.sgml | 15 +++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/docs/reference/ChangeLog b/docs/reference/ChangeLog index e8d8a39dc3..42d12e2ecc 100644 --- a/docs/reference/ChangeLog +++ b/docs/reference/ChangeLog @@ -1,3 +1,8 @@ +2006-05-08 Matthias Clasen + + * gtk/question_index.sgml (reference): Update the internationalization + answer. (#340951, Kristof Versant) + 2006-05-04 Matthias Clasen * === Released 2.9.0 === diff --git a/docs/reference/gtk/question_index.sgml b/docs/reference/gtk/question_index.sgml index da2c310fce..771059a357 100644 --- a/docs/reference/gtk/question_index.sgml +++ b/docs/reference/gtk/question_index.sgml @@ -205,13 +205,15 @@ You eventually have to call gettext() on the string to actually fetch the translation. _() both marks the string for translation and actually translates it. +Nowadays, GLib provides the common shorthand macros in the header file +gi18n.h, so you don't have to define them yourself, just +include that header. + + Code using these macros ends up looking like this: - #include <libintl.h> - - #define _(x) gettext (x) - #define N_(x) x + #include <gi18n.h> static const char *global_variable = N_("Translate this string"); @@ -238,6 +240,11 @@ of using the default.For dgettext() the _() macro can be defined as: + +Again, GLib comes with the gi18n-lib.h, saving you the trouble +of defining the macros by hand. The macros in that header expect the translation +domain to be specified by the %GETTEXT_PACKAGE macro. + -- 2.30.2